﻿using System;
using Microsoft.Practices.Prism.Regions;
using Infrastucture;
using Infrastucture.Controllers;

namespace TimeSplicerModule.Controllers
{
    public interface ITeamController : IController
    { }

    public class TeamController : Controller, ITeamController
    {

        public void NavigateToListView()
        {
            Uri uri = new Uri(typeof(Views.TeamListView).Name, UriKind.Relative);
            RegionManager.RequestNavigate(Infrastucture.RegionNames.MainRegion, uri);
        }

        public void NavigateToItemView()
        {
            Uri uri = new Uri(typeof(Views.TeamView).Name, UriKind.Relative);
            RegionManager.RequestNavigate(Infrastucture.RegionNames.MainRegion, uri);
        }

        public void NavigateToItemView(Guid teamGuid)
        {
            Uri uri = new Uri(typeof(Views.TeamView).Name 
                + "?teamGuid=" + teamGuid.ToString(), UriKind.Relative);
            RegionManager.RequestNavigate(RegionNames.MainRegion, uri);
        }
    }
}
